<?template name="chat_setting"?>
<fieldset>
<legend>Настройки чата</legend>
<div></div>
<form method="post" action="?"
onsubmit="window.chat_setting_submit(this);return false">
<input type="hidden" name="cmd" value="chat">
<input type="checkbox" name="clock" value="1"{{if clock}} checked{{/if}}>
: часы
<br>
<input type="checkbox" name="trans" value="1"{{if trans}} checked{{/if}}>
: транслитерация
<br>
<input type="checkbox" name="smiles" value="1"{{if smiles}} checked{{/if}}>
: смайлики
<br>
<input type="checkbox" name="animate" value="1"{{if animate}} checked{{/if}}>
: анимация прокрутки
<br>
<input type="text" size="5" name="max_str" value="${max_str}">
: держать строк в чате
<br>
<input type="checkbox" name="timing" value="1"{{if timing}} checked{{/if}}>
: тайминг записи на ленту
<br>
<input type="submit" value="сохранить">
</form>
</fieldset>

<script>
window.chat_setting_submit = null;
window.chat_setting_submit_data = null;
window.chat_setting_submit_data = function(data){
	if(data && !data.errror){
		mc.main.set_setting(data);
		mc.panel.redraw();
	}
	var item = $.tmplItem(this);
	item.data = mc.setting;
	item.update();
};
window.chat_setting_submit = function(form){
	mc.request(
		"setting",
		{
			cmd: "chat.save",
			clock: form.clock.checked || 0,
			trans: form.trans.checked || 0,
			smiles: form.smiles.checked || 0,
			timing: form.timing.checked || 0,
			animate: form.animate.checked || 0,
			max_str: form.max_str.value
		},
		window.chat_setting_submit_data,
		form
		);
};
</script>

<?/template?>
